package com.ysstech.valuation.feign.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.ysstech.valuation.entity.Account;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 财务余额信息表
 * </p>
 *
 * @author lishuangliang
 * @since 2021-04-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("fin_balance")
public class Balance extends Model<Balance> {

    private static final long serialVersionUID = 1L;

    @TableId("ID")
    private String id;

    /**
     * 科目代码
     */
    @TableField("SUBJECT_ID")
    private String subjectId;

    /**
     * 证券代码
     */
    @TableField("SECURITIES_CODE")
    private String securitiesCode;
    /**
     * 基金编码
     */
    @TableField("ACCOUNT_ID")
    private String accountId;
    /**
     * 日期
     */
    @TableField("FDATE")
    private LocalDate fdate;
    /**
     * 币种
     */
    @TableField("CURRENCY")
    private String currency;
    /**
     * 期初余额
     */
    @TableField("BEGINNING_BALANCE")
    private BigDecimal beginningBalance = BigDecimal.ZERO;
    /**
     * 借方发生金额
     */
    @TableField("CURRENT_DEBIT_MONEY")
    private BigDecimal currentDebitMoney = BigDecimal.ZERO;
    /**
     * 贷方发生金额
     */
    @TableField("CURRENT_CREDIT_MONEY")
    private BigDecimal currentCreditMoney = BigDecimal.ZERO;
    /**
     * 累计借方发生金额
     */
    @TableField("TOTAL_CURRENT_DEBIT_MONEY")
    private BigDecimal totalCurrentDebitMoney = BigDecimal.ZERO;
    /**
     * 累计贷方发生金额
     */
    @TableField("TOTAL_CURRENT_CREDIT_MONEY")
    private BigDecimal totalCurrentCreditMoney = BigDecimal.ZERO;
    /**
     * 期末余额
     */
    @TableField("END_BALANCE")
    private BigDecimal endBalance = BigDecimal.ZERO;
    /**
     * 期初数量
     */
    @TableField("BEGINNING_AMOUNT")
    private BigDecimal beginningAmount = BigDecimal.ZERO;
    /**
     * 借方发生数量
     */
    @TableField("CURRENT_DEBIT_AMOUNT")
    private BigDecimal currentDebitAmount = BigDecimal.ZERO;
    /**
     * 贷方发生数量
     */
    @TableField("CURRENT_CREDIT_AMOUNT")
    private BigDecimal currentCreditAmount = BigDecimal.ZERO;
    /**
     * 累计借方发生数量
     */
    @TableField("TOTAL_CURRENT_DEBIT_AMOUNT")
    private BigDecimal totalCurrentDebitAmount = BigDecimal.ZERO;
    /**
     * 累计贷方发生数量
     */
    @TableField("TOTAL_CURRENT_CREDIT_AMOUNT")
    private BigDecimal totalCurrentCreditAmount = BigDecimal.ZERO;
    /**
     * 期末数量
     */
    @TableField("END_AMOUNT")
    private BigDecimal endAmount = BigDecimal.ZERO;

    /**
     * 状态
     */
    @TableField("STATUS")
    private Integer status;
    /**
     * 数据来源 1.凭证来源，2.手工
     */
    @TableField("SOURCE")
    private int source;
    /**
     * 添加时间
     */
    @TableField("ADD_TIME")
    private LocalDateTime addTime;

    /**
     * 添加用户
     */
    @TableField("ADD_USER")
    private String addUser;

    /**
     * 修改时间
     */
    @TableField("EDIT_TIME")
    private LocalDateTime editTime;

    /**
     * 修改用户
     */
    @TableField("EDIT_USER")
    private String editUser;
    /**
     * 删除原因
     */
    @TableField("DELETE_REASON")
    private String deleteReason;

    @Override
    protected Serializable pkVal() {
        return null;
    }

    //开始日期
    @TableField(exist = false)
    private String startDate;
    //结束日期
    @TableField(exist = false)
    private String endDate;
    //查询条件
    @TableField(exist = false)
    private String selfdate;
    //基金信息
    @TableField(exist = false)
    private Account account;

    //科目代码
    @TableField(exist = false)
    private String subjectCode;
    //科目名称
    @TableField(exist = false)
    private String subjectName;

    @TableField(exist = false)
    private Integer amount;
    @TableField(exist = false)
    private Integer assetsType;
    /**
     * 表格树字段
     */
    @TableField(exist = false)
    private Integer detailed; //是否明细科目
    @TableField(exist = false)
    private String parentId; // 父级节点id
    @TableField(exist = false)
    private String _parentId; // 父级节点id
    @TableField(exist = false)
    private String state;  //状态，默认 open 可以closed
    @TableField(exist = false)
    private String iconCls; //图标
    @TableField(exist = false)
    private boolean checked; //是否选中
}
